

cap program drop standardize_Procurement_Type
program standardize_Procurement_Type, rclass
	args jurisdiction
	if ustrregexm("`jurisdiction'", "[Gg]eorgia"){
	    gen construction = ustrregexm(procuringcategory, "(?: [Ww]ork|building|painting|construction|Mechanical installations)")==1 ///
				& ustrregexm(procuringcategory, "(?:clothing|limestone)")==0
		gen supplies = ustrregexm(procuringcategory, "supplies") & construction == 0
		gen services = ustrregexm(procuringcategory, "services") & construction == 0
		replace supplies = 1 if construction == 0 & supplies == 0 & services == 0
		gen Procurement_Type = "Work" if construction == 1
		replace Procurement_Type = "Services" if services == 1
		replace Procurement_Type = "Supplies" if supplies == 1
	}
	
	else if ustrregexm("`jurisdiction'", "[Mm]ongolia"){
		rename contract Procurement_Type
		replace Procurement_Type = usubinstr(Procurement_Type, "Goods", "Supplies", .)
		replace Procurement_Type = usubinstr(Procurement_Type, "Consulting services", "Services (Consulting)",.)
		replace Procurement_Type = usubinstr(Procurement_Type, "Services other than consulting", "Services (Other)",.)
		replace Procurement_Type = usubinstr(Procurement_Type, "Ашигт малтмалын тусгай зөвшөөрөл", "Mining license",.)
	}
	*return scaler r...
end				